Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Features/ban unban #27

Merged
merged 7 commits into from
Feb 29, 2024
Merged

Features/ban unban #27

merged 7 commits into from
Feb 29, 2024

Conversation

Alexi-Reyes
Copy link
Collaborator

No description provided.

@Kan-A-Pesh Kan-A-Pesh self-requested a review February 27, 2024 16:37
@Kan-A-Pesh Kan-A-Pesh added the pending-review Lorsque vous envoyez votre PR, ajoutez ce label pour vérification. label Feb 27, 2024
Copy link
Member

@Kan-A-Pesh Kan-A-Pesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ALEXIS TU AS PRIS LA MAUVAISE BRANCHE 😡😡😡

const { email } = req.body;

const isDevinciEmail = (email: string): boolean => {
const expression: RegExp = /^[a-zA-Z0-9._-]+@edu\.devinci.fr$/;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Il manque un \ sur le point

// Regex actuel
 const expression: RegExp = /^[a-zA-Z0-9._-]+@edu\.devinci.fr$/;
// Regex juste
 const expression: RegExp = /^[a-zA-Z0-9._-]+@edu\.devinci\.fr$/;

@@ -22,6 +35,44 @@ class AccountController {
* * Send a success message
* * Send an error message if the email is invalid
*/
const { email } = req.body;

const isDevinciEmail = (email: string): boolean => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pas besoin de faire une fonction si elle n'est utilisé qu'une fois

return expression.test(email);
};

if (isDevinciEmail(email) == true) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pas besoin de sur-vérifié la boolean if (isDevinciEmail(email)) { suffit

const link: string = `url/login?token=${token}`;

const transporter = nodemailer.createTransport({
host: "your_host",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plus judicieux de mettre une variable d'environnement (exemple. process.env.MAIL_HOST) ce qui simplifie aussi le test du code en local

port: 587,
secure: true,
auth: {
user: "your_email_address",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

secure: true,
auth: {
user: "your_email_address",
pass: "your_email_password",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

});

const message = {
from: "your_email",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

@Kan-A-Pesh Kan-A-Pesh added wrong-branch in-correction and removed pending-review Lorsque vous envoyez votre PR, ajoutez ce label pour vérification. labels Feb 27, 2024
@Kan-A-Pesh Kan-A-Pesh merged commit cbbe1ed into dev Feb 29, 2024
1 check passed
@Kan-A-Pesh Kan-A-Pesh deleted the features/ban-unban branch February 29, 2024 18:40
@Kan-A-Pesh Kan-A-Pesh added pending-review Lorsque vous envoyez votre PR, ajoutez ce label pour vérification. and removed in-correction wrong-branch labels Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-review Lorsque vous envoyez votre PR, ajoutez ce label pour vérification.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants